package top.revery.admin.controller_common;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import top.revery.admin.util.FeignServiceMapping;
import top.revery.api.config.HttpResponResult;
import top.revery.api.config.ResultType;
import top.revery.api.entity.other.BaseWebPages;

/**
 * <h1> ---  --- </h1>
 * Created by  revery.top jun
 * Date  2020-01-16 16:09
 */
@RestController
@RequestMapping("/common/web/")
public class WebPageService {

    @RequestMapping("/getHome")
    Object getHome(){
        return null;
    }

    @RequestMapping("/getWebPages")
    Object getWebPages(Long id){
        HttpResponResult httpResponResult = null;

        BaseWebPages webPages = FeignServiceMapping.webPagesDataSource.getWebPage(id);
        if(webPages!=null){
            httpResponResult = new HttpResponResult(ResultType.SUCCESS);
            httpResponResult.put("webPages",webPages);
        }else{
            httpResponResult = new HttpResponResult(ResultType.ERROR_SERVICE,"获取失败！");
        }
        return httpResponResult;
    }
}
